from pyecharts.charts import Map
from pyecharts.options import TitleOpts, VisualMapOpts

map = Map()

data = [
    ("北京市",100),
    ("广东省",200),
    ("河北省",230),
    ("四川省",200),
    ("云南省",260),
    ("湖北省",200)
]


map.add("测试地图",data,"china")

# 设置全局选项
map.set_global_opts(
    visualmap_opts=VisualMapOpts(
        is_show=True,
        pieces=[
            {"min": 1, "max": 9, "label": "1-9", "color": "#CCFFFF"},
            {"min": 10, "max": 99, "label": "10-99", "color": "#FF6666"},
            {"min": 100, "max": 500, "label": "100-500", "color": "#990033"}
        ]
    ),
    title_opts=TitleOpts(title="地图",pos_left="center",pos_bottom="1%"),



)

map.render()









